include $(TOPDIR)/rules.mk

PKG_NAME:=luci-app-adbyby
PKG_VERSION:=1.0
PKG_RELEASE:=1

include $(INCLUDE_DIR)/package.mk

define Package/luci-app-adbyby
SECTION:=LuCI
CATEGORY:=LuCI
SUBMENU:=3. Applications
TITLE:=LuCI Support for adbyby
DEPENDS:=+adbyby
PKGARCH:=all
endef

define Package/luci-app-adbyby/description
LuCI Support for adbyby
endef

define Build/Compile
endef

define Package/luci-app-adbyby/postinst
#!/bin/sh
( . /etc/uci-defaults/luci-adbyby ) && rm -f /etc/uci-defaults/luci-adbyby
exit 0
endef

define Package/luci-app-adbyby/postrm
#!/bin/sh
uci -q batch <<-EOF >/dev/null
	delete ucitrack.@adbyby[-1]
	commit ucitrack
EOF
rm -f /tmp/luci-indexcache
rm -rf /tmp/luci-modulecache
exit 0
endef

define Package/luci-app-adbyby/install
	$(CP) ./root/* $(1)
	$(INSTALL_DIR) $(1)/etc/uci-defaults
	$(INSTALL_BIN) ./files/luci-adbyby.uci $(1)/etc/uci-defaults/luci-adbyby
endef

$(eval $(call BuildPackage,luci-app-adbyby))
